package com.heima.apis.article;

import com.heima.apis.article.fallback.IArticleClientFallback;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.article.pojos.ApArticle;
import com.heima.model.article.pojos.ApArticleConfig;
import com.heima.model.article.pojos.ApCollection;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmCommentListDto;
import com.heima.model.wemedia.dtos.WmStatistics3Dto;
import com.heima.model.wemedia.pojos.WmNewsStatistics;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "leadnews-article",fallback = IArticleClientFallback.class)
public interface IArticleClient {

    @PostMapping("/api/v1/article/save")
    public ResponseResult saveAppArticle(@RequestBody ArticleDto articleDto);

    @PostMapping("/api/v1/article/findCount")
    Integer findCount(@RequestBody WmStatistics3Dto wmStatistics3Dto);

    @PostMapping("/api/v1/article/comment_list")
    public ResponseResult commentList(@RequestBody WmCommentListDto dto);


    @PostMapping("/api/v1/article/findArticle")
    ApArticle findArticle(@RequestBody Long articleId);

    @PostMapping("/api/v1/article/findByPublishTime")
    List<WmNewsStatistics> findByPublishTime(@RequestBody WmStatistics3Dto wmStatistics3Dto);

    @PostMapping("/api/v1/article/findArticleConfig")
    ApArticleConfig findArticleConfig(@RequestBody Long articleId);

    @PostMapping("/api/v1/article/findArticleCollection")
    ApCollection findArticleCollectionById(@RequestBody Long articleId);
}
